<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.io.stream.DigestStream</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.io.stream.DigestStream");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DigestStream.d?rev=3327">tango.io.stream.DigestStream</a></h1>
                
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Version:</b><br>
Initial release: Oct 2007<br><br>
<b>author:</b><br>Kris<br><br>
<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DigestStream.d?rev=3327#L26">DigestInput</a></span>
<script>explorer.outline.addDecl('DigestInput');</script> : InputFilter;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Inject a digest filter into an input stream, updating the digest
        as information flows through it</font><br><br>
<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DigestStream.d?rev=3327#L36">this</a></span>
<script>explorer.outline.addDecl('this');</script>(InputStream <span class="funcparam">stream</span>, Digest <span class="funcparam">digest</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Accepts any input stream, and any digest derivation</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DigestStream.d?rev=3327#L52">read</a></span>
<script>explorer.outline.addDecl('read');</script>(void[] <span class="funcparam">dst</span>); [override, final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Read from conduit into a target array. The provided dst 
                will be populated with content from the conduit. </font><br><br>
<font color="black">Returns the number of bytes read, which may be less than
                requested in dst &#40;or IOStream.Eof for end-of-flow&#41;<br><br></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Digest <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DigestStream.d?rev=3327#L67">digest</a></span>
<script>explorer.outline.addDecl('digest');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return the Digest instance we were created with. Use this
                to access the resultant binary or hex digest value</font><br><br></dd></dl>
<script>explorer.outline.decSymbolLevel();</script></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DigestStream.d?rev=3327#L88">DigestOutput</a></span>
<script>explorer.outline.addDecl('DigestOutput');</script> : OutputFilter;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Inject a digest filter into an output stream, updating the digest
        as information flows through it. Here's an example where we calculate
        an MD5 digest as a side-effect of copying a file:
        <pre class="d_code">

        <span class="k">auto</span> <span class="i">output</span> = <span class="k">new</span> <span class="i">DigestOutput</span>(<span class="k">new</span> <span class="i">FileOutput</span>(<span class="sl">"output"</span>), <span class="k">new</span> <span class="i">Md5</span>);
        <span class="i">output</span>.<span class="i">copy</span> (<span class="k">new</span> <span class="i">FileInput</span>(<span class="sl">"input"</span>));

        <span class="i">Stdout</span>.<span class="i">formatln</span> (<span class="sl">"hex digest: {}"</span>, <span class="i">output</span>.<span class="i">digest</span>.<span class="i">hexDigest</span>);
        
</pre></font><br><br>
<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DigestStream.d?rev=3327#L98">this</a></span>
<script>explorer.outline.addDecl('this');</script>(OutputStream <span class="funcparam">stream</span>, Digest <span class="funcparam">digest</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Accepts any output stream, and any digest derivation</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DigestStream.d?rev=3327#L114">write</a></span>
<script>explorer.outline.addDecl('write');</script>(void[] <span class="funcparam">src</span>); [override, final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Write to conduit from a source array. The provided src
                content will be written to the conduit.</font><br><br>
<font color="black">Returns the number of bytes written from src, which may
                be less than the quantity provided<br><br></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Digest <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DigestStream.d?rev=3327#L129">digest</a></span>
<script>explorer.outline.addDecl('digest');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return the Digest instance we were created with. Use this
                to access the resultant binary or hex digest value</font><br><br></dd></dl>
<script>explorer.outline.decSymbolLevel();</script></dd></dl>
<script>explorer.outline.decSymbolLevel();</script></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2007 Kris Bell. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Tue Mar  4 22:45:33 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>